import {
    postMethod,
    getMethod
} from './axios.js'

export default {
    login(data) {
        return postMethod('/api/user/login', data)
    },
    statue() {
        return getMethod('/api/user/statue', {})
    },
    register(data) {
        return postMethod('/api/user/register', data)
    },
    comment(noteId, text) {
        return postMethod("/api/user/commemt/create", {
            noteid: noteId,
            text: text
        })
    },
    commentedit(commentid, text) {
        return postMethod("/api/user/commemt/edit", {
            commentid: commentid,
            text: text
        })
    },
    info(userid) {
        return getMethod("/api/user/info", {
            userid: userid
        })
    },
    notes(userid) {
        return getMethod("/api/note/note/createby", {
            createby: userid
        })
    },
    noteedit(noteid, text, title) {
        return postMethod("/api/user/note/edit", {
            noteid: noteid,
            text: text,
            tittle: title
        })
    },
    changePass(userpass) {
        return postMethod("/api/user/updateUserInfo", {
            password: userpass
        })
    },
    changeNickname(nickname) {
        return postMethod("/api/user/updateUserInfo", {
            nickname: nickname
        })
    },
    changeHeadimg(headimg) {
        return postMethod("/api/user/updateUserInfo", {
            headimg: headimg
        })
    }
}